package com.bnzj.cloud.business.core.constant;

import lombok.Getter;

/**
 * @author Barry
 * @createDate 2020/2/14
 * @description
 */
public interface ManagerConstant {

    @Getter
    enum UserStatus {
        ON_THE_JOB(1, "在职"),
        LEAVE_THE_JOB(0, "离职");
        private Integer code;
        private String message;

        UserStatus(Integer code, String message) {
            this.code = code;
            this.message = message;
        }
    }

    @Getter
    enum JobStatus {
        TASK_EXECUTED_SUCCESS(1, "执行成功"),
        TASK_EXECUTION_FAILED(0, "执行失败");
        private Integer code;
        private String message;

        JobStatus(Integer code, String message) {
            this.code = code;
            this.message = message;
        }
    }

    @Getter
    enum ResourceType {
        RESOURCE_TYPE_0(0, "页面菜单"),
        RESOURCE_TYPE_1(1, "页面按钮"),
        RESOURCE_TYPE_2(2, "工具条按钮"),
        RESOURCE_TYPE_3(3, "行操作"),
        RESOURCE_TYPE_4(4, "弹出页面"),
        UNKNOWN(5, "未知");
        private Integer code;
        private String message;

        ResourceType(Integer code, String message) {
            this.code = code;
            this.message = message;
        }

        public static ResourceType getEnumType(Integer key) {
            ResourceType[] alarmGrades = ResourceType.values();
            for (ResourceType resourceType : alarmGrades) {
                if (resourceType.getCode().equals(key)) {
                    return resourceType;
                }
            }
            return ResourceType.UNKNOWN;
        }



        @Getter
       public  enum RoleCode {
            PURCHASE("purchase", "采购"),
            HR("hr", "HR"),
            SYSTEM_ADMIN("admin", "系统管理员"),
            DEPARTMENT_OF_SECURITY("itsafe", "安全部对接人"),
            SUPPLIER("supplier", "供应商"),
            PROJECT_MANAGER("pm", "项目经理");
            private String code;
            private String message;

            RoleCode(String code, String message) {
                this.code = code;
                this.message = message;
            }
        }

    }
}
